#!/usr/bin/env ruby1.9
# encoding: UTF-8

require './lib/hindo.rb'

describe Word, "word" do
    it "joins kanji and kana to make a key" do
        Word.make_key("one", "two").should == "one:two"
    end

    it "has a key value" do
        Word.new("a", "b", "c").key.should == "a:b"
    end
end

describe LatinTagger, "words" do
    it "returns words" do
        tagger = LatinTagger.new
        word = tagger.words("sdcsd")[0]
        word.kanji.should == "sdcsd"
        word.kana.should == ""
    end

    it "returns kanji and kana" do
        tagger = LatinTagger.new
        words = tagger.words("this is a test")
        words[0].kanji.should == "this"
        words[0].kana.should == ""
        words[1].kanji.should == "is"
        words[1].kana.should == ""
        words[2].kanji.should == "a"
        words[2].kana.should == ""
        words[3].kanji.should == "test"
        words[3].kana.should == ""
    end

end
